package cc.vv.btpartyjob.partymanager.adapter

import android.widget.TextView
import cc.vv.baselibrary.adapter.SimpleCommonAdapter
import cc.vv.baselibrary.adapter.holder.ExtendViewHolder
import cc.vv.baselibrary.view.OvalImageView
import cc.vv.btpartyjob.partymanager.R
import cc.vv.btpartyjob.partymanager.moudel.bean.CommunityAcBean
import cc.vv.btpartyjob.partymanager.moudel.bean.CommunityActivitiesBean
import cc.vv.lkimagecomponent2.LKImage
import cc.vv.lkimagecomponent2.lib.mode.ScaleMode

/**
 * 社区活动adapter
 * Created by Chen.qi on 2018/10/24.
 */
class CommunityActivitiesAdapter(layoutResId: Int) : SimpleCommonAdapter<CommunityAcBean>(layoutResId) {
    override fun convert(helper: ExtendViewHolder, item: CommunityAcBean, position: Int) {
        //封面
        LKImage.load().scale(ScaleMode.CENTER_CROP)
                .crossFade(300).placeHolder(R.mipmap.icon_def_image)
                .error(R.mipmap.icon_def_image).load(item.cover).into(helper.getView<OvalImageView>(R.id.oiv_aca_itemPic))
        //title
        helper.getView<TextView>(R.id.tv_aca_communityTitleItem)?.text = item.title
        //内容描述
        helper.getView<TextView>(R.id.tv_aca_communityDesc)?.text = item.organizer
        //时间
        helper.getView<TextView>(R.id.tv_aca_communityTime)?.text = item.activityTime
    }
}